import static java.lang.Thread.sleep;

/**
 * Creat with IntelliJ IDEA
 * Description
 * User: mamba24
 * Date: 2022-08-10
 * Time: 21:44
 * To BE A Better Person-2020-3-2
 */
public class TestDemo4 {
    public static void main(String[] args) throws InterruptedException {
        Thread t1=new Thread(()->{
            try {
                sleep(1000);
                System.out.println("我是线程1");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        });

        Thread t2=Thread.currentThread();
        System.out.println(t1.getName());
        System.out.println(t2.getName());
    }
}
